import axios from './config'
import { AxiosPromise } from 'axios'
import {IfoodList, IfoodTypes} from './config/responseType'

/**
 * 获取食品分类列表
 */
//输入参数
export const reqFoodTypes = ():AxiosPromise<IfoodTypes[]> => {
    return axios.request({
        url:'/v2/index_entry',
        method:'GET',
    })
}

/**
 * 获取shop中的食品列表
 */
//输入参数
interface reqFoodListArgInterface {
    restaurant_id:string | (string | null)[]
}
export const reqFoodList = (params:reqFoodListArgInterface):AxiosPromise<IfoodList[]> => {
    return axios.request({
        url:'/shopping/v2/menu',
        params: params,
        method:'GET',
    })
}
